home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Nejlepší hry
/
Nejlepsi hry.iso
/
hry
/
sea of chaos
/
sea_install.msi
/
_15C39AAA7726369D39812BD40F01CF6A
/
_E9A39D9BD50D44309CEB523485CE869D
< prev
next >
Wrap
Text File
|
2004-11-24
|
976b
|
53 lines
//sky vertex shader:
//moves texture coordinates with time
//Luke Lenhart
//(C)2004-2005 Digipen Institute of Technology
//world,view,projection transform
float4x4 matWorldViewProj;
//current time (in seconds) since whenever
float curTime;
//alpha amount of layer
float alpha;
//scale level of texture sampling
float scale;
//shader input
struct VS_INPUT
{
float4 Pos : POSITION;
float4 Color : COLOR;
float2 Tex0 : TEXCOORD0;
};
//shader output
struct VS_OUTPUT
{
float4 Pos : POSITION;
float4 Color : COLOR;
float2 Tex0 : TEXCOORD0;
};
//shader code
VS_OUTPUT VShader(VS_INPUT In)
{
VS_OUTPUT Out;
//calc transformed position
Out.Pos=mul(matWorldViewProj,In.Pos);
//adjust texture coordinate
Out.Tex0=scale*(In.Tex0+curTime*float2(0.03f,0.0013f));
//copy color through
Out.Color=In.Color;
Out.Color.a*=alpha;
//spit out the results
return Out;
}